/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Vistas.java
 *
 * Created on 23-dic-2011, 21:31:09
 */
package AplicacionMVC;

import java.awt.event.ActionListener;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import java.util.Map;
import javax.swing.JComboBox;
import funciones.*;
import funciones.TipoFormulario.Tipo;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.MouseAdapter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.Set;
import javax.swing.DefaultCellEditor;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.ListModel;
import javax.swing.border.Border;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;

/**
 *
 * @author Jesus Ruiz Oliva
 */
public class Vistas extends javax.swing.JPanel {
      Locale locale;
      ResourceBundle mensajes;
      String userIncorrect;
    /** Creates new form Vistas */
    public Vistas() {
        locale= Locale.getDefault();
        mensajes=ResourceBundle.getBundle("panel1", locale);
        userIncorrect=mensajes.getString("aviso");
        histograma = new Histogram();
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panel1 = new javax.swing.JPanel(){

            public void paintComponent(Graphics g)
            {
                URL url = getClass().getResource("/imagenes/pills_by_dizzywithpink.jpg");
                if(url != null)
                {
                    Dimension tamanio = getSize();
                    ImageIcon fondo = new ImageIcon(url);
                    g.drawImage(fondo.getImage(), 0, 0, tamanio.width, tamanio.height, null);
                    setOpaque(false);
                    super.paintComponent(g);
                }
            }
        };
        jPanel1 = new javax.swing.JPanel();
        Button1 = new javax.swing.JButton();
        pass = new javax.swing.JPasswordField();
        etiqueta3 = new javax.swing.JLabel();
        etiqueta2 = new javax.swing.JLabel();
        user = new javax.swing.JTextField();
        etiqueta1 = new javax.swing.JLabel();
        buttonExit = new javax.swing.JButton();
        errorLogin = new javax.swing.JLabel();
        jLabelIdioma = new javax.swing.JLabel();
        ES = new javax.swing.JLabel();
        US = new javax.swing.JLabel();
        panel2 = new javax.swing.JPanel()

        {

            public void paintComponent(Graphics g)
            {
                URL url = getClass().getResource("/imagenes/pills_by_Serret.jpg");
                if(url != null)
                {
                    Dimension tamanio = getSize();
                    ImageIcon fondo = new ImageIcon(url);
                    g.drawImage(fondo.getImage(), 0, 0, tamanio.width, tamanio.height, null);
                    setOpaque(false);
                    super.paintComponent(g);
                }
            }
        }
        ;
        panelMedico = new javax.swing.JPanel();
        fotoMedico = new javax.swing.JLabel();
        nombreMedico = new javax.swing.JLabel();
        consultaMedico = new javax.swing.JLabel();
        emailMedico = new javax.swing.JLabel();
        telefonoMedico = new javax.swing.JLabel();
        Button5 = new javax.swing.JButton();
        Button3 = new javax.swing.JButton();
        buttonLogout = new javax.swing.JButton();
        panelCitas = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        listModelCitas = new DefaultListModel();
        jList1 = new javax.swing.JList(listModelCitas);
        PanelDatosCita = new javax.swing.JPanel();
        DNIPacienteMotivo = new javax.swing.JLabel();
        NSSPacienteMotivo = new javax.swing.JLabel();
        MotivoPacienteMotivo = new javax.swing.JLabel();
        FotoPacienteMotivo = new javax.swing.JLabel();
        FechaPacienteMotivo = new javax.swing.JLabel();
        panel4 = new javax.swing.JPanel()
        {

            public void paintComponent(Graphics g)
            {
                URL url = getClass().getResource("/imagenes/fondografico.jpg");
                if(url != null)
                {
                    Dimension tamanio = getSize();
                    ImageIcon fondo = new ImageIcon(url);
                    g.drawImage(fondo.getImage(), 0, 0, tamanio.width, tamanio.height, null);
                    setOpaque(false);
                    super.paintComponent(g);
                }
            }
        }
        ;
        GraficoBarras = new javax.swing.JPanel();
        Valores = new javax.swing.JPanel();
        Enero = new javax.swing.JLabel();
        Febrero = new javax.swing.JLabel();
        Marzo = new javax.swing.JLabel();
        Abril = new javax.swing.JLabel();
        Mayo = new javax.swing.JLabel();
        Junio = new javax.swing.JLabel();
        Julio = new javax.swing.JLabel();
        Agosto = new javax.swing.JLabel();
        Septiembre = new javax.swing.JLabel();
        Octubre = new javax.swing.JLabel();
        Noviembre = new javax.swing.JLabel();
        Diciembre = new javax.swing.JLabel();
        histogramaSalir = new javax.swing.JButton();
        añoHistograma = new javax.swing.JComboBox();
        panel5 = new javax.swing.JPanel()
        {

            public void paintComponent(Graphics g)
            {
                URL url = getClass().getResource("/imagenes/fondocorreo.jpeg");
                if(url != null)
                {
                    Dimension tamanio = getSize();
                    ImageIcon fondo = new ImageIcon(url);
                    g.drawImage(fondo.getImage(), 0, 0, tamanio.width, tamanio.height, null);
                    setOpaque(false);
                    super.paintComponent(g);
                }
            }
        }
        ;
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        listModel = new DefaultListModel();
        jList2 = new javax.swing.JList(listModel);
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jButton3 = new javax.swing.JButton();
        panelFormularioGenerico = new javax.swing.JScrollPane();
        panel7 = new javax.swing.JPanel()
        {

            public void paintComponent(Graphics g)
            {
                URL url = getClass().getResource("/imagenes/pills_by_Serret.jpg");
                if(url != null)
                {
                    Dimension tamanio = getSize();
                    ImageIcon fondo = new ImageIcon(url);
                    g.drawImage(fondo.getImage(), 0, 0, tamanio.width, tamanio.height, null);
                    setOpaque(false);
                    super.paintComponent(g);
                }
            }
        }
        ;
        button_Formulario_Cancelar = new javax.swing.JButton();
        button_Formulario_Guardar = new javax.swing.JButton();
        PanelDatosPaciente1 = new javax.swing.JPanel();
        DNIPaciente = new javax.swing.JLabel();
        NSSPaciente = new javax.swing.JLabel();
        NombrePaciente = new javax.swing.JLabel();
        DireccionPaciente = new javax.swing.JLabel();
        TelefonoPaciente = new javax.swing.JLabel();
        FotoPaciente1 = new javax.swing.JLabel();
        NacimientoPaciente = new javax.swing.JLabel();
        EmailPaciente = new javax.swing.JLabel();
        TratamientosActuales = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTableTratamientosActuales = new javax.swing.JTable();
        jLabelTratamiento = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jScrollPane9 = new javax.swing.JScrollPane();
        jTableMedicinas = new javax.swing.JTable();
        jScrollPane10 = new javax.swing.JScrollPane();
        jTableCuras = new javax.swing.JTable();
        jScrollPane11 = new javax.swing.JScrollPane();
        jTableOtros = new javax.swing.JTable();
        jLabel5 = new javax.swing.JLabel();
        jButtonHistorial = new javax.swing.JButton();
        jButtonPruebas = new javax.swing.JButton();
        buttonFotoCam = new javax.swing.JButton();
        jButtonImprimir = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jLabelComentario = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTextAreaDiagnostico = new javax.swing.JTextArea();
        jScrollPane7 = new javax.swing.JScrollPane();
        jTextAreaComentario = new javax.swing.JTextArea();
        jScrollPane8 = new javax.swing.JScrollPane();
        jTextAreaExamenPreliminar = new javax.swing.JTextArea();
        jLabelAlergias = new javax.swing.JLabel();
        jLabelDiscapacidades = new javax.swing.JLabel();
        jButtonCambiarFormulario = new javax.swing.JButton();
        jButtonAddRowMedicinas = new javax.swing.JButton();
        jButtonDeleteRowMedicinas = new javax.swing.JButton();
        jButtonAddRowOtros = new javax.swing.JButton();
        jButtonDeleteRowOtros = new javax.swing.JButton();
        jButtonAddRowCuras = new javax.swing.JButton();
        jButtonDeleteRowCuras = new javax.swing.JButton();
        jScrollPane14 = new javax.swing.JScrollPane();
        listModelFormularioAlergias = new DefaultListModel();
        jListFormularioAlergias = new javax.swing.JList(listModelFormularioAlergias);
        jScrollPane15 = new javax.swing.JScrollPane();
        listModelFormularioDiscapacidades = new DefaultListModel();
        jListFormularioDiscapacidades = new javax.swing.JList(listModelFormularioDiscapacidades);
        jButtonAgregarAlergia = new javax.swing.JButton();
        jButtonAgregarDiscapacidad = new javax.swing.JButton();
        jButtonEliminarDiscapacidad = new javax.swing.JButton();
        jButtonEliminarAlergia = new javax.swing.JButton();
        jLabelAvisoDiagnostico = new javax.swing.JLabel();
        panelCambiarMotivo = new javax.swing.JPanel()
        {

            public void paintComponent(Graphics g)
            {
                URL url = getClass().getResource("/imagenes/pills_by_Serret.jpg");
                if(url != null)
                {
                    Dimension tamanio = getSize();
                    ImageIcon fondo = new ImageIcon(url);
                    g.drawImage(fondo.getImage(), 0, 0, tamanio.width, tamanio.height, null);
                    setOpaque(false);
                    super.paintComponent(g);
                }
            }
        }
        ;
        buttonCambiarMotivoAtras = new javax.swing.JButton();
        jScrollPane6 = new javax.swing.JScrollPane();
        listModelCambiarMotivo = new DefaultListModel();
        jListCambiarMotivo = new javax.swing.JList(listModelCambiarMotivo);
        jLabelTipoFormulario = new javax.swing.JLabel();
        panelHistorial = new javax.swing.JPanel()

        {

            public void paintComponent(Graphics g)
            {
                URL url = getClass().getResource("/imagenes/pills_by_Serret.jpg");
                if(url != null)
                {
                    Dimension tamanio = getSize();
                    ImageIcon fondo = new ImageIcon(url);
                    g.drawImage(fondo.getImage(), 0, 0, tamanio.width, tamanio.height, null);
                    setOpaque(false);
                    super.paintComponent(g);
                }
            }
        }
        ;
        tabHistorial = new javax.swing.JTabbedPane();
        scrollAlergias = new javax.swing.JScrollPane();
        listModelAlergias = new DefaultListModel();
        jListAlergias = new javax.swing.JList(listModelAlergias);
        scrollDiscapacidades = new javax.swing.JScrollPane();
        listModelDiscapacidades = new DefaultListModel();
        jListDiscapacidades = new javax.swing.JList(listModelDiscapacidades);
        scrollCuras = new javax.swing.JScrollPane();
        jTableHistorialCuras = new javax.swing.JTable();
        scrollPruebas = new javax.swing.JScrollPane();
        jTablePruebas = new javax.swing.JTable();
        scrollDiagnosticos = new javax.swing.JScrollPane();
        jTableHistorialDiagnosticos = new javax.swing.JTable();
        scrollMedicamentos = new javax.swing.JScrollPane();
        jTableHistorialMedicamentos = new javax.swing.JTable();
        scrollOtros = new javax.swing.JScrollPane();
        jTableHistorialOtros = new javax.swing.JTable();
        jButtonHistorialAtras = new javax.swing.JButton();
        tabHistorialDiagnosticos = new javax.swing.JTabbedPane();
        scrollDiagnosticosCuras = new javax.swing.JScrollPane();
        jTableDiagnosticosCuras = new javax.swing.JTable();
        scrollDiagnosticosOtros = new javax.swing.JScrollPane();
        jTableDiagnosticosOtros = new javax.swing.JTable();
        scrollDiagnosticosMedicamentos = new javax.swing.JScrollPane();
        jTableDiagnosticosMedicamentos = new javax.swing.JTable();
        panelSolicitarPruebas = new javax.swing.JPanel()
        {

            public void paintComponent(Graphics g)
            {
                URL url = getClass().getResource("/imagenes/pills_by_Serret.jpg");
                if(url != null)
                {
                    Dimension tamanio = getSize();
                    ImageIcon fondo = new ImageIcon(url);
                    g.drawImage(fondo.getImage(), 0, 0, tamanio.width, tamanio.height, null);
                    setOpaque(false);
                    super.paintComponent(g);
                }
            }
        }
        ;
        scrollListaPruebas = new javax.swing.JScrollPane();
        listaPruebasModel = new DefaultListModel();
        listaPruebas = new javax.swing.JList(listaPruebasModel);
        jButtonCancelarPuebas = new javax.swing.JButton();
        jScrollPane16 = new javax.swing.JScrollPane();
        jTextAreaPrueba = new javax.swing.JTextArea();
        jLabelComentarioPrueba = new javax.swing.JLabel();
        jComboBoxPrioridad = new javax.swing.JComboBox();
        jLabelPrioridad = new javax.swing.JLabel();
        jButtonAceptarPrueba = new javax.swing.JButton();
        jLabelAviso = new javax.swing.JLabel();
        panelAgregarAlergia = new javax.swing.JPanel()
        {

            public void paintComponent(Graphics g)
            {
                URL url = getClass().getResource("/imagenes/pills_by_Serret.jpg");
                if(url != null)
                {
                    Dimension tamanio = getSize();
                    ImageIcon fondo = new ImageIcon(url);
                    g.drawImage(fondo.getImage(), 0, 0, tamanio.width, tamanio.height, null);
                    setOpaque(false);
                    super.paintComponent(g);
                }
            }
        }
        ;
        buttonCambiarMotivoAtras1 = new javax.swing.JButton();
        jScrollPane12 = new javax.swing.JScrollPane();
        listModelAgregarAlergia = new DefaultListModel();
        jListAgregarAlergia = new javax.swing.JList(listModelAgregarAlergia);
        jLabelTipoAlergia = new javax.swing.JLabel();
        panelAgregarDiscapacidad = new javax.swing.JPanel()
        {

            public void paintComponent(Graphics g)
            {
                URL url = getClass().getResource("/imagenes/pills_by_Serret.jpg");
                if(url != null)
                {
                    Dimension tamanio = getSize();
                    ImageIcon fondo = new ImageIcon(url);
                    g.drawImage(fondo.getImage(), 0, 0, tamanio.width, tamanio.height, null);
                    setOpaque(false);
                    super.paintComponent(g);
                }
            }
        }
        ;
        buttonCambiarMotivoAtras2 = new javax.swing.JButton();
        jScrollPane13 = new javax.swing.JScrollPane();
        listModelAgregarDiscapacidad = new DefaultListModel();
        jListAgregarDiscapacidad = new javax.swing.JList(listModelAgregarDiscapacidad);
        jLabelTipoDiscapacidad = new javax.swing.JLabel();

        setLayout(new java.awt.CardLayout());

        jPanel1.setBackground(new java.awt.Color(153, 153, 255));
        jPanel1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 102, 255), 2, true));

        Button1.setText("Aceptar");

        pass.setText("emilio");

        etiqueta3.setText(mensajes.getString("contraseña"));

        etiqueta2.setText(mensajes.getString("usuario"));

        user.setText("emperezsanchez@gmail.com");
        user.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userActionPerformed(evt);
            }
        });

        etiqueta1.setFont(new java.awt.Font("Times New Roman", 1, 18));
        etiqueta1.setText(mensajes.getString("inicio"));

        buttonExit.setText("Salir");

        errorLogin.setForeground(new java.awt.Color(255, 51, 51));

        jLabelIdioma.setText(mensajes.getString("idioma"));

        ES.setText("ES");
        ES.setIcon(new ImageIcon(getClass().getResource("/imagenes/es.png")));
        ES.setText("");

        US.setText("US");
        US.setIcon(new ImageIcon(getClass().getResource("/imagenes/uk.png")));
        US.setText("");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(181, 181, 181)
                .addComponent(etiqueta1, javax.swing.GroupLayout.DEFAULT_SIZE, 2679, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(etiqueta3, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(etiqueta2, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(29, 29, 29)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(errorLogin, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(pass)
                            .addComponent(user, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(43, 43, 43)
                        .addComponent(Button1))
                    .addComponent(jLabelIdioma))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(buttonExit)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(ES)
                        .addGap(18, 18, 18)
                        .addComponent(US)))
                .addGap(2344, 2344, 2344))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(45, Short.MAX_VALUE)
                .addComponent(etiqueta1)
                .addGap(36, 36, 36)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(etiqueta2)
                    .addComponent(user, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(44, 44, 44)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(etiqueta3)
                    .addComponent(pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Button1)
                    .addComponent(buttonExit))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(errorLogin)
                .addGap(34, 34, 34)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(US)
                    .addComponent(ES)
                    .addComponent(jLabelIdioma))
                .addGap(21, 21, 21))
        );

        javax.swing.GroupLayout panel1Layout = new javax.swing.GroupLayout(panel1);
        panel1.setLayout(panel1Layout);
        panel1Layout.setHorizontalGroup(
            panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel1Layout.createSequentialGroup()
                .addContainerGap(2216, Short.MAX_VALUE)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 569, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(618, 618, 618))
        );
        panel1Layout.setVerticalGroup(
            panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel1Layout.createSequentialGroup()
                .addContainerGap(1357, Short.MAX_VALUE)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(262, 262, 262))
        );

        add(panel1, "card2");

        panelMedico.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos personales", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 0, 18), new java.awt.Color(0, 0, 0))); // NOI18N

        fotoMedico.setText("Foto");

        nombreMedico.setText("Nombre");

        consultaMedico.setText("Email");

        emailMedico.setText("Consulta");

        telefonoMedico.setText("Telefono");

        Button5.setText("Correo");

        Button3.setText("Estadístico");

        javax.swing.GroupLayout panelMedicoLayout = new javax.swing.GroupLayout(panelMedico);
        panelMedico.setLayout(panelMedicoLayout);
        panelMedicoLayout.setHorizontalGroup(
            panelMedicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelMedicoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(consultaMedico)
                .addContainerGap(573, Short.MAX_VALUE))
            .addGroup(panelMedicoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(nombreMedico)
                .addContainerGap(559, Short.MAX_VALUE))
            .addGroup(panelMedicoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(emailMedico)
                .addContainerGap(555, Short.MAX_VALUE))
            .addGroup(panelMedicoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(telefonoMedico)
                .addContainerGap(554, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelMedicoLayout.createSequentialGroup()
                .addContainerGap(545, Short.MAX_VALUE)
                .addComponent(fotoMedico)
                .addGap(46, 46, 46))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelMedicoLayout.createSequentialGroup()
                .addContainerGap(433, Short.MAX_VALUE)
                .addComponent(Button5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Button3)
                .addContainerGap())
        );
        panelMedicoLayout.setVerticalGroup(
            panelMedicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelMedicoLayout.createSequentialGroup()
                .addContainerGap(40, Short.MAX_VALUE)
                .addComponent(fotoMedico)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(nombreMedico)
                .addGap(28, 28, 28)
                .addComponent(consultaMedico)
                .addGap(23, 23, 23)
                .addComponent(emailMedico)
                .addGap(26, 26, 26)
                .addComponent(telefonoMedico)
                .addGap(18, 18, 18)
                .addGroup(panelMedicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Button5)
                    .addComponent(Button3))
                .addContainerGap())
        );

        buttonLogout.setText("Cerrar cesión");

        panelCitas.setBorder(javax.swing.BorderFactory.createTitledBorder("Citas"));

        jList1.setBackground(new java.awt.Color(240, 240, 240));
        jList1.setCellRenderer(new DefaultListCellRenderer(){
            @Override
            public Component getListCellRendererComponent(JList list, Object value,
                int index,boolean isSelected, boolean cellHasFocus) {
                PacienteCita paciente = (PacienteCita)value;
                setText("Nombre: " + paciente.getNombre()+ " DNI: " + paciente.getDNI());

                if (isSelected) {
                    setBackground(Color.LIGHT_GRAY);
                }
                else{
                    if (paciente.getEstaAtendido())
                    setBackground(Color.GRAY);
                    else
                    setBackground(Color.WHITE);
                }
                return this;

            }
        });
        jList1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane2.setViewportView(jList1);

        javax.swing.GroupLayout panelCitasLayout = new javax.swing.GroupLayout(panelCitas);
        panelCitas.setLayout(panelCitasLayout);
        panelCitasLayout.setHorizontalGroup(
            panelCitasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelCitasLayout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 478, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(29, Short.MAX_VALUE))
        );
        panelCitasLayout.setVerticalGroup(
            panelCitasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelCitasLayout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 467, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(24, Short.MAX_VALUE))
        );

        PanelDatosCita.setVisible(false);
        PanelDatosCita.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos Cita", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 0, 18))); // NOI18N

        DNIPacienteMotivo.setText("DNI");

        NSSPacienteMotivo.setText("NSS");

        MotivoPacienteMotivo.setText("Motivo");

        FechaPacienteMotivo.setText("Fecha");

        javax.swing.GroupLayout PanelDatosCitaLayout = new javax.swing.GroupLayout(PanelDatosCita);
        PanelDatosCita.setLayout(PanelDatosCitaLayout);
        PanelDatosCitaLayout.setHorizontalGroup(
            PanelDatosCitaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelDatosCitaLayout.createSequentialGroup()
                .addGroup(PanelDatosCitaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(DNIPacienteMotivo)
                    .addComponent(NSSPacienteMotivo))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 155, Short.MAX_VALUE)
                .addGroup(PanelDatosCitaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(MotivoPacienteMotivo)
                    .addComponent(FechaPacienteMotivo))
                .addGap(80, 80, 80)
                .addComponent(FotoPacienteMotivo, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        PanelDatosCitaLayout.setVerticalGroup(
            PanelDatosCitaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelDatosCitaLayout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(PanelDatosCitaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DNIPacienteMotivo)
                    .addComponent(MotivoPacienteMotivo))
                .addGap(18, 18, 18)
                .addGroup(PanelDatosCitaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(FechaPacienteMotivo, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
                    .addComponent(NSSPacienteMotivo))
                .addGap(150, 150, 150))
            .addGroup(PanelDatosCitaLayout.createSequentialGroup()
                .addComponent(FotoPacienteMotivo, javax.swing.GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout panel2Layout = new javax.swing.GroupLayout(panel2);
        panel2.setLayout(panel2Layout);
        panel2Layout.setHorizontalGroup(
            panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel2Layout.createSequentialGroup()
                .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panel2Layout.createSequentialGroup()
                        .addGap(30, 30, 30)
                        .addComponent(buttonLogout))
                    .addGroup(panel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(panelMedico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panel2Layout.createSequentialGroup()
                        .addGap(41, 41, 41)
                        .addComponent(PanelDatosCita, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(77, 77, 77)
                .addComponent(panelCitas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(2171, 2171, 2171))
        );
        panel2Layout.setVerticalGroup(
            panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panelCitas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(panel2Layout.createSequentialGroup()
                        .addComponent(panelMedico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(buttonLogout)
                        .addGap(145, 145, 145)
                        .addComponent(PanelDatosCita, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(1109, Short.MAX_VALUE))
        );

        add(panel2, "card3");

        panel4.setLayout(null);

        GraficoBarras.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Gráfico", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 0, 18), new java.awt.Color(0, 0, 0))); // NOI18N
        GraficoBarras.add(histograma);
        GraficoBarras.setLayout(new java.awt.GridLayout(1, 0));
        panel4.add(GraficoBarras);
        GraficoBarras.setBounds(120, 100, 630, 420);

        Valores.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Valores", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 0, 18), new java.awt.Color(0, 0, 0))); // NOI18N

        Enero.setText("jLabel1");

        Febrero.setText("jLabel2");

        Marzo.setText("jLabel3");

        Abril.setText("jLabel7");

        Mayo.setText("jLabel8");

        Junio.setText("jLabel9");

        Julio.setText("jLabel10");

        Agosto.setText("jLabel11");

        Septiembre.setText("jLabel12");

        Octubre.setText("jLabel13");

        Noviembre.setText("jLabel14");

        Diciembre.setText("jLabel15");

        javax.swing.GroupLayout ValoresLayout = new javax.swing.GroupLayout(Valores);
        Valores.setLayout(ValoresLayout);
        ValoresLayout.setHorizontalGroup(
            ValoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ValoresLayout.createSequentialGroup()
                .addGap(44, 44, 44)
                .addGroup(ValoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(Enero)
                    .addComponent(Junio)
                    .addComponent(Mayo)
                    .addComponent(Abril)
                    .addComponent(Marzo)
                    .addComponent(Febrero))
                .addGap(176, 176, 176)
                .addGroup(ValoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(Julio)
                    .addComponent(Diciembre)
                    .addComponent(Noviembre)
                    .addComponent(Octubre)
                    .addComponent(Septiembre)
                    .addComponent(Agosto))
                .addContainerGap(209, Short.MAX_VALUE))
        );
        ValoresLayout.setVerticalGroup(
            ValoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ValoresLayout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addGroup(ValoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(ValoresLayout.createSequentialGroup()
                        .addComponent(Julio)
                        .addGap(30, 30, 30)
                        .addComponent(Agosto)
                        .addGap(33, 33, 33)
                        .addComponent(Septiembre)
                        .addGap(33, 33, 33)
                        .addComponent(Octubre)
                        .addGap(36, 36, 36)
                        .addComponent(Noviembre)
                        .addGap(38, 38, 38)
                        .addComponent(Diciembre))
                    .addGroup(ValoresLayout.createSequentialGroup()
                        .addComponent(Enero)
                        .addGap(30, 30, 30)
                        .addComponent(Febrero)
                        .addGap(33, 33, 33)
                        .addComponent(Marzo)
                        .addGap(33, 33, 33)
                        .addComponent(Abril)
                        .addGap(36, 36, 36)
                        .addComponent(Mayo)
                        .addGap(38, 38, 38)
                        .addComponent(Junio)))
                .addContainerGap(88, Short.MAX_VALUE))
        );

        panel4.add(Valores);
        Valores.setBounds(900, 100, 530, 420);

        histogramaSalir.setText("Atrás");
        histogramaSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                histogramaSalirActionPerformed(evt);
            }
        });
        panel4.add(histogramaSalir);
        histogramaSalir.setBounds(120, 540, 80, 25);

        añoHistograma.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        panel4.add(añoHistograma);
        añoHistograma.setBounds(790, 110, 64, 22);

        //funciones.Histogram h = new funciones.Histogram();

        add(panel4, "card5");

        jButton1.setText("<");

        jButton2.setText(">");

        jList2.setCellRenderer(new DefaultListCellRenderer(){
            @Override
            public Component getListCellRendererComponent(JList list, Object value,
                int index,boolean isSelected, boolean cellHasFocus) {
                Mensaje mensaje=(Mensaje)value;
                setText(mensaje.getMensaje());
                setIcon(mensaje.getImage());
                if (isSelected)
                setBackground(Color.LIGHT_GRAY);
                else
                setBackground(Color.WHITE);
                return this;
            }
        });
        jScrollPane3.setViewportView(jList2);

        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        jScrollPane1.setViewportView(jTextArea1);

        jButton3.setText("Atras");

        javax.swing.GroupLayout panel5Layout = new javax.swing.GroupLayout(panel5);
        panel5.setLayout(panel5Layout);
        panel5Layout.setHorizontalGroup(
            panel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel5Layout.createSequentialGroup()
                .addGap(47, 47, 47)
                .addGroup(panel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButton3)
                    .addGroup(panel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panel5Layout.createSequentialGroup()
                            .addGap(1032, 1032, 1032)
                            .addComponent(jButton1)
                            .addGap(18, 18, 18)
                            .addComponent(jButton2))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panel5Layout.createSequentialGroup()
                            .addGap(47, 47, 47)
                            .addGroup(panel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1085, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jScrollPane3)))))
                .addContainerGap(2224, Short.MAX_VALUE))
        );
        panel5Layout.setVerticalGroup(
            panel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel5Layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(panel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton2)
                    .addComponent(jButton1))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(43, 43, 43)
                .addComponent(jButton3)
                .addContainerGap(1249, Short.MAX_VALUE))
        );

        add(panel5, "card6");

        panelFormularioGenerico.setBorder(null);

        button_Formulario_Cancelar.setText("Cancelar");

        button_Formulario_Guardar.setText("Guardar");

        PanelDatosPaciente1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos Paciente", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 0, 18))); // NOI18N

        DNIPaciente.setText("DNI");

        NSSPaciente.setText("NSS");

        NombrePaciente.setText("Nombre");

        DireccionPaciente.setText("Dirección");

        TelefonoPaciente.setText("Teléfono");

        NacimientoPaciente.setText("Nacimiento");

        EmailPaciente.setText("Email");

        javax.swing.GroupLayout PanelDatosPaciente1Layout = new javax.swing.GroupLayout(PanelDatosPaciente1);
        PanelDatosPaciente1.setLayout(PanelDatosPaciente1Layout);
        PanelDatosPaciente1Layout.setHorizontalGroup(
            PanelDatosPaciente1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelDatosPaciente1Layout.createSequentialGroup()
                .addGroup(PanelDatosPaciente1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PanelDatosPaciente1Layout.createSequentialGroup()
                        .addGroup(PanelDatosPaciente1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(DNIPaciente)
                            .addComponent(NSSPaciente)
                            .addComponent(NombrePaciente))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 203, Short.MAX_VALUE)
                        .addGroup(PanelDatosPaciente1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(TelefonoPaciente)
                            .addComponent(EmailPaciente)
                            .addComponent(NacimientoPaciente))
                        .addGap(70, 70, 70))
                    .addGroup(PanelDatosPaciente1Layout.createSequentialGroup()
                        .addComponent(DireccionPaciente)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addComponent(FotoPaciente1, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        PanelDatosPaciente1Layout.setVerticalGroup(
            PanelDatosPaciente1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(FotoPaciente1, javax.swing.GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelDatosPaciente1Layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(PanelDatosPaciente1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DNIPaciente)
                    .addComponent(TelefonoPaciente))
                .addGap(18, 18, 18)
                .addGroup(PanelDatosPaciente1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EmailPaciente, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
                    .addComponent(NSSPaciente))
                .addGap(14, 14, 14)
                .addGroup(PanelDatosPaciente1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(NombrePaciente)
                    .addComponent(NacimientoPaciente))
                .addGap(18, 18, 18)
                .addComponent(DireccionPaciente)
                .addGap(99, 99, 99))
        );

        TratamientosActuales.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Tratamientos Actuales", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 0, 18))); // NOI18N
        TratamientosActuales.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        TratamientosActuales.setPreferredSize(new java.awt.Dimension(504, 292));

        jTableTratamientosActuales.setModel(tableModelTratamientosActuales);
        jTableTratamientosActuales.getTableHeader().setReorderingAllowed(false) ;
        jScrollPane5.setViewportView(jTableTratamientosActuales);

        javax.swing.GroupLayout TratamientosActualesLayout = new javax.swing.GroupLayout(TratamientosActuales);
        TratamientosActuales.setLayout(TratamientosActualesLayout);
        TratamientosActualesLayout.setHorizontalGroup(
            TratamientosActualesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(TratamientosActualesLayout.createSequentialGroup()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 785, Short.MAX_VALUE)
                .addContainerGap())
        );
        TratamientosActualesLayout.setVerticalGroup(
            TratamientosActualesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, TratamientosActualesLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 233, Short.MAX_VALUE)
                .addContainerGap())
        );

        jLabelTratamiento.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabelTratamiento.setText("Tratamientos");

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel4.setText("Examen Preliminar");

        jTableMedicinas.setModel(tableModelMedicinas);
        jTableMedicinas.getTableHeader().setReorderingAllowed(false) ;
        jScrollPane9.setViewportView(jTableMedicinas);

        jTableCuras.setModel(tableModelCuras);
        jTableCuras.getTableHeader().setReorderingAllowed(false) ;
        jScrollPane10.setViewportView(jTableCuras);

        jTableOtros.setModel(tableModelOtros);
        jTableOtros.getTableHeader().setReorderingAllowed(false) ;
        jScrollPane11.setViewportView(jTableOtros);

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 18));
        jLabel5.setText("Formulario: Genérico");

        jButtonHistorial.setText("Historial");

        jButtonPruebas.setText("Solicitar Prueba");

        buttonFotoCam.setText("Foto con Cam");

        jButtonImprimir.setText("Imprimir");

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel6.setText("Diagnostico");

        jLabelComentario.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabelComentario.setText("Comentario");

        jTextAreaDiagnostico.setColumns(20);
        jTextAreaDiagnostico.setRows(5);
        jScrollPane4.setViewportView(jTextAreaDiagnostico);

        jTextAreaComentario.setColumns(20);
        jTextAreaComentario.setRows(5);
        jScrollPane7.setViewportView(jTextAreaComentario);

        jTextAreaExamenPreliminar.setColumns(20);
        jTextAreaExamenPreliminar.setRows(5);
        jScrollPane8.setViewportView(jTextAreaExamenPreliminar);

        jLabelAlergias.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabelAlergias.setText("Alergias");

        jLabelDiscapacidades.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabelDiscapacidades.setText("Discapacidades");

        jButtonCambiarFormulario.setText("Cambiar Formulario");

        jButtonAddRowMedicinas.setText("+");
        jButtonAddRowMedicinas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAddRowMedicinasActionPerformed(evt);
            }
        });

        jButtonDeleteRowMedicinas.setText("-");
        jButtonDeleteRowMedicinas.setMaximumSize(new java.awt.Dimension(41, 23));
        jButtonDeleteRowMedicinas.setMinimumSize(new java.awt.Dimension(41, 23));
        jButtonDeleteRowMedicinas.setPreferredSize(new java.awt.Dimension(41, 23));

        jButtonAddRowOtros.setText("+");

        jButtonDeleteRowOtros.setText("-");
        jButtonDeleteRowOtros.setMaximumSize(new java.awt.Dimension(41, 23));
        jButtonDeleteRowOtros.setMinimumSize(new java.awt.Dimension(41, 23));
        jButtonDeleteRowOtros.setPreferredSize(new java.awt.Dimension(41, 23));

        jButtonAddRowCuras.setText("+");

        jButtonDeleteRowCuras.setText("-");
        jButtonDeleteRowCuras.setMaximumSize(new java.awt.Dimension(41, 23));
        jButtonDeleteRowCuras.setMinimumSize(new java.awt.Dimension(41, 23));
        jButtonDeleteRowCuras.setPreferredSize(new java.awt.Dimension(41, 23));

        jScrollPane14.setViewportView(jListFormularioAlergias);

        jScrollPane15.setViewportView(jListFormularioDiscapacidades);

        jButtonAgregarAlergia.setText("Agregar");

        jButtonAgregarDiscapacidad.setText("Agregar");

        jButtonEliminarDiscapacidad.setText("Eliminar");

        jButtonEliminarAlergia.setText("Eliminar");

        jLabelAvisoDiagnostico.setFont(new java.awt.Font("Tahoma", 1, 18));
        jLabelAvisoDiagnostico.setForeground(new java.awt.Color(204, 0, 0));

        javax.swing.GroupLayout panel7Layout = new javax.swing.GroupLayout(panel7);
        panel7.setLayout(panel7Layout);
        panel7Layout.setHorizontalGroup(
            panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel7Layout.createSequentialGroup()
                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(jLabelAvisoDiagnostico))
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(PanelDatosPaciente1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(140, 140, 140)
                        .addComponent(TratamientosActuales, javax.swing.GroupLayout.PREFERRED_SIZE, 809, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(21, 21, 21)
                        .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panel7Layout.createSequentialGroup()
                                .addComponent(jButtonHistorial)
                                .addGap(18, 18, 18)
                                .addComponent(jButtonPruebas)
                                .addGap(18, 18, 18)
                                .addComponent(jButtonCambiarFormulario)
                                .addGap(12, 12, 12)
                                .addComponent(buttonFotoCam)
                                .addGap(18, 18, 18)
                                .addComponent(jButtonImprimir)
                                .addGap(681, 681, 681)
                                .addComponent(button_Formulario_Cancelar)
                                .addGap(7, 7, 7)
                                .addComponent(button_Formulario_Guardar))
                            .addGroup(panel7Layout.createSequentialGroup()
                                .addComponent(jLabel4)
                                .addGap(606, 606, 606)
                                .addComponent(jLabel6))
                            .addGroup(panel7Layout.createSequentialGroup()
                                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 504, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(224, 224, 224)
                                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 764, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(panel7Layout.createSequentialGroup()
                                .addComponent(jLabelTratamiento)
                                .addGap(648, 648, 648)
                                .addComponent(jLabelComentario))
                            .addGroup(panel7Layout.createSequentialGroup()
                                .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 504, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(7, 7, 7)
                                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jButtonAddRowMedicinas)
                                    .addComponent(jButtonDeleteRowMedicinas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(176, 176, 176)
                                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 764, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(panel7Layout.createSequentialGroup()
                                .addGap(738, 738, 738)
                                .addComponent(jLabelAlergias))
                            .addGroup(panel7Layout.createSequentialGroup()
                                .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 504, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(7, 7, 7)
                                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jButtonAddRowCuras)
                                    .addComponent(jButtonDeleteRowCuras, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(176, 176, 176)
                                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 764, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(panel7Layout.createSequentialGroup()
                                        .addGap(570, 570, 570)
                                        .addComponent(jButtonEliminarAlergia)
                                        .addGap(21, 21, 21)
                                        .addComponent(jButtonAgregarAlergia))))
                            .addGroup(panel7Layout.createSequentialGroup()
                                .addGap(1308, 1308, 1308)
                                .addComponent(jButtonEliminarDiscapacidad)
                                .addGap(21, 21, 21)
                                .addComponent(jButtonAgregarDiscapacidad))
                            .addGroup(panel7Layout.createSequentialGroup()
                                .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 504, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(7, 7, 7)
                                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jButtonAddRowOtros)
                                    .addComponent(jButtonDeleteRowOtros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(176, 176, 176)
                                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabelDiscapacidades)
                                    .addComponent(jScrollPane15, javax.swing.GroupLayout.PREFERRED_SIZE, 764, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                .addContainerGap(23, Short.MAX_VALUE))
        );
        panel7Layout.setVerticalGroup(
            panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel7Layout.createSequentialGroup()
                .addGap(13, 13, 13)
                .addComponent(jLabel5)
                .addGap(18, 18, 18)
                .addComponent(jLabelAvisoDiagnostico)
                .addGap(25, 25, 25)
                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addComponent(TratamientosActuales, javax.swing.GroupLayout.DEFAULT_SIZE, 290, Short.MAX_VALUE))
                    .addComponent(PanelDatosPaciente1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(54, 54, 54)
                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jButtonHistorial))
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jButtonPruebas))
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jButtonCambiarFormulario))
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(buttonFotoCam))
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jButtonImprimir))
                    .addComponent(button_Formulario_Cancelar)
                    .addComponent(button_Formulario_Guardar))
                .addGap(18, 18, 18)
                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jLabel6)))
                .addGap(3, 3, 3)
                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelTratamiento)
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(jLabelComentario)))
                .addGap(13, 13, 13)
                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jButtonAddRowMedicinas)
                        .addGap(67, 67, 67)
                        .addComponent(jButtonDeleteRowMedicinas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(1, 1, 1)
                .addComponent(jLabelAlergias)
                .addGap(13, 13, 13)
                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jButtonAddRowCuras)
                        .addGap(67, 67, 67)
                        .addComponent(jButtonDeleteRowCuras, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(8, 8, 8)
                        .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButtonEliminarAlergia)
                            .addComponent(jButtonAgregarAlergia))))
                .addGap(11, 11, 11)
                .addComponent(jLabelDiscapacidades)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panel7Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(jButtonAddRowOtros)
                        .addGap(53, 53, 53)
                        .addComponent(jButtonDeleteRowOtros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane15, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3)
                .addGroup(panel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButtonEliminarDiscapacidad)
                    .addComponent(jButtonAgregarDiscapacidad))
                .addGap(141, 141, 141))
        );

        TratamientosActuales.getAccessibleContext().setAccessibleName("");

        panelFormularioGenerico.setViewportView(panel7);

        add(panelFormularioGenerico, "cardFormularioGenerico");

        buttonCambiarMotivoAtras.setText("Atrás");

        jScrollPane6.setViewportView(jListCambiarMotivo);

        jLabelTipoFormulario.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabelTipoFormulario.setText("Seleccione el tipo de formulario:");

        javax.swing.GroupLayout panelCambiarMotivoLayout = new javax.swing.GroupLayout(panelCambiarMotivo);
        panelCambiarMotivo.setLayout(panelCambiarMotivoLayout);
        panelCambiarMotivoLayout.setHorizontalGroup(
            panelCambiarMotivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelCambiarMotivoLayout.createSequentialGroup()
                .addGap(146, 146, 146)
                .addGroup(panelCambiarMotivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(buttonCambiarMotivoAtras)
                    .addGroup(panelCambiarMotivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabelTipoFormulario)
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 499, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(2758, Short.MAX_VALUE))
        );
        panelCambiarMotivoLayout.setVerticalGroup(
            panelCambiarMotivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelCambiarMotivoLayout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addComponent(jLabelTipoFormulario)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonCambiarMotivoAtras)
                .addContainerGap(1586, Short.MAX_VALUE))
        );

        add(panelCambiarMotivo, "cardCambiarMotivo");

        tabHistorial.setName("fcb"); // NOI18N

        jListAlergias.setCellRenderer(new DefaultListCellRenderer(){
            @Override
            public Component getListCellRendererComponent(JList list, Object value,
                int index,boolean isSelected, boolean cellHasFocus) {
                Historial historia = (Historial)value;
                setText(historia.getNombre());

                if (isSelected) {
                    setBackground(Color.LIGHT_GRAY);
                }
                else{
                    setBackground(Color.WHITE);
                }
                return this;

            }
        });
        scrollAlergias.setViewportView(jListAlergias);

        tabHistorial.addTab("Alergias", scrollAlergias);

        jListDiscapacidades.setCellRenderer(new DefaultListCellRenderer(){
            @Override
            public Component getListCellRendererComponent(JList list, Object value,
                int index,boolean isSelected, boolean cellHasFocus) {
                Discapacidades disca = (Discapacidades)value;
                setText(disca.getNombre());

                if (isSelected) {
                    setBackground(Color.LIGHT_GRAY);
                }
                else{
                    setBackground(Color.WHITE);
                }
                return this;

            }
        });
        scrollDiscapacidades.setViewportView(jListDiscapacidades);

        tabHistorial.addTab("Discapacidades", scrollDiscapacidades);

        jTableHistorialCuras.setModel(tableModelHistorialCuras);
        scrollCuras.setViewportView(jTableHistorialCuras);

        tabHistorial.addTab("Curas", scrollCuras);

        jTablePruebas.setModel(tableModelHistorialPruebas);
        scrollPruebas.setViewportView(jTablePruebas);

        tabHistorial.addTab("Pruebas", scrollPruebas);

        jTableHistorialDiagnosticos.setModel(tableModelHistorialDiagnosticos);
        jTableHistorialDiagnosticos.getTableHeader().setReorderingAllowed(false);
        scrollDiagnosticos.setViewportView(jTableHistorialDiagnosticos);

        tabHistorial.addTab("Diagnosticos", scrollDiagnosticos);

        jTableHistorialMedicamentos.setModel(tableModelHistorialMedicamentos);
        scrollMedicamentos.setViewportView(jTableHistorialMedicamentos);

        tabHistorial.addTab("Medicamentos", scrollMedicamentos);

        jTableHistorialOtros.setModel(tableModelHistorialOtros);
        scrollOtros.setViewportView(jTableHistorialOtros);

        tabHistorial.addTab("Otros", scrollOtros);

        jButtonHistorialAtras.setText("Atras");

        tabHistorialDiagnosticos.setVisible(false);

        jTableDiagnosticosCuras.setModel(tableModelDiagnosticosCuras);
        scrollDiagnosticosCuras.setViewportView(jTableDiagnosticosCuras);

        tabHistorialDiagnosticos.addTab("Curas", scrollDiagnosticosCuras);

        jTableDiagnosticosOtros.setModel(tableModelDiagnosticosOtros);
        scrollDiagnosticosOtros.setViewportView(jTableDiagnosticosOtros);

        tabHistorialDiagnosticos.addTab("Otros", scrollDiagnosticosOtros);

        jTableDiagnosticosMedicamentos.setModel(tableModelDiagnosticosMedicamentos);
        scrollDiagnosticosMedicamentos.setViewportView(jTableDiagnosticosMedicamentos);

        tabHistorialDiagnosticos.addTab("Medicamentos", scrollDiagnosticosMedicamentos);

        javax.swing.GroupLayout panelHistorialLayout = new javax.swing.GroupLayout(panelHistorial);
        panelHistorial.setLayout(panelHistorialLayout);
        panelHistorialLayout.setHorizontalGroup(
            panelHistorialLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelHistorialLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelHistorialLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButtonHistorialAtras, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tabHistorial, javax.swing.GroupLayout.PREFERRED_SIZE, 746, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(tabHistorialDiagnosticos, javax.swing.GroupLayout.PREFERRED_SIZE, 478, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(2149, Short.MAX_VALUE))
        );
        panelHistorialLayout.setVerticalGroup(
            panelHistorialLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelHistorialLayout.createSequentialGroup()
                .addGroup(panelHistorialLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelHistorialLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(tabHistorial, javax.swing.GroupLayout.PREFERRED_SIZE, 512, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonHistorialAtras))
                    .addGroup(panelHistorialLayout.createSequentialGroup()
                        .addGap(31, 31, 31)
                        .addComponent(tabHistorialDiagnosticos, javax.swing.GroupLayout.PREFERRED_SIZE, 492, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(1344, Short.MAX_VALUE))
        );

        tabHistorial.getAccessibleContext().setAccessibleName("");

        add(panelHistorial, "cardHistorial");

        listaPruebas.setCellRenderer(new DefaultListCellRenderer(){
            @Override
            public Component getListCellRendererComponent(JList list, Object value,
                int index,boolean isSelected, boolean cellHasFocus) {
                Mensaje mensaje=(Mensaje)value;
                setText(mensaje.getMensaje());
                setIcon(mensaje.getImage());

                if (isSelected)
                setBackground(Color.LIGHT_GRAY);
                else
                setBackground(Color.WHITE);
                return this;
            }
        });
        scrollListaPruebas.setViewportView(listaPruebas);

        jButtonCancelarPuebas.setText("Cancelar");
        jButtonCancelarPuebas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCancelarPuebasActionPerformed(evt);
            }
        });

        jTextAreaPrueba.setColumns(20);
        jTextAreaPrueba.setRows(5);
        jScrollPane16.setViewportView(jTextAreaPrueba);

        jLabelComentarioPrueba.setText("Comentario");

        jComboBoxPrioridad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
        jComboBoxPrioridad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxPrioridadActionPerformed(evt);
            }
        });

        jLabelPrioridad.setText("Prioridad");

        jButtonAceptarPrueba.setText("Solicitar Prueba");

        jLabelAviso.setFont(new java.awt.Font("Tahoma", 1, 18));
        jLabelAviso.setForeground(new java.awt.Color(255, 0, 0));
        jLabelAviso.setToolTipText("");

        javax.swing.GroupLayout panelSolicitarPruebasLayout = new javax.swing.GroupLayout(panelSolicitarPruebas);
        panelSolicitarPruebas.setLayout(panelSolicitarPruebasLayout);
        panelSolicitarPruebasLayout.setHorizontalGroup(
            panelSolicitarPruebasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelSolicitarPruebasLayout.createSequentialGroup()
                .addGroup(panelSolicitarPruebasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelSolicitarPruebasLayout.createSequentialGroup()
                        .addGap(91, 91, 91)
                        .addComponent(jButtonCancelarPuebas)
                        .addGap(91, 91, 91)
                        .addComponent(jButtonAceptarPrueba))
                    .addGroup(panelSolicitarPruebasLayout.createSequentialGroup()
                        .addGap(39, 39, 39)
                        .addComponent(scrollListaPruebas, javax.swing.GroupLayout.PREFERRED_SIZE, 452, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(45, 45, 45)
                        .addGroup(panelSolicitarPruebasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jComboBoxPrioridad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelPrioridad)
                            .addComponent(jScrollPane16, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelComentarioPrueba)))
                    .addGroup(panelSolicitarPruebasLayout.createSequentialGroup()
                        .addGap(158, 158, 158)
                        .addComponent(jLabelAviso)))
                .addContainerGap(2664, Short.MAX_VALUE))
        );
        panelSolicitarPruebasLayout.setVerticalGroup(
            panelSolicitarPruebasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelSolicitarPruebasLayout.createSequentialGroup()
                .addGroup(panelSolicitarPruebasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelSolicitarPruebasLayout.createSequentialGroup()
                        .addGap(45, 45, 45)
                        .addComponent(jLabelAviso)
                        .addGap(41, 41, 41)
                        .addComponent(scrollListaPruebas, javax.swing.GroupLayout.PREFERRED_SIZE, 506, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(panelSolicitarPruebasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButtonCancelarPuebas)
                            .addComponent(jButtonAceptarPrueba)))
                    .addGroup(panelSolicitarPruebasLayout.createSequentialGroup()
                        .addGap(53, 53, 53)
                        .addComponent(jLabelComentarioPrueba)
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(30, 30, 30)
                        .addComponent(jLabelPrioridad)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxPrioridad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(1266, Short.MAX_VALUE))
        );

        add(panelSolicitarPruebas, "card9");

        buttonCambiarMotivoAtras1.setText("Atrás");

        jScrollPane12.setViewportView(jListAgregarAlergia);

        jLabelTipoAlergia.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabelTipoAlergia.setText("Seleccione el tipo de Alergia:");

        javax.swing.GroupLayout panelAgregarAlergiaLayout = new javax.swing.GroupLayout(panelAgregarAlergia);
        panelAgregarAlergia.setLayout(panelAgregarAlergiaLayout);
        panelAgregarAlergiaLayout.setHorizontalGroup(
            panelAgregarAlergiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAgregarAlergiaLayout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(panelAgregarAlergiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelTipoAlergia)
                    .addGroup(panelAgregarAlergiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(buttonCambiarMotivoAtras1)
                        .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 480, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(2899, Short.MAX_VALUE))
        );
        panelAgregarAlergiaLayout.setVerticalGroup(
            panelAgregarAlergiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAgregarAlergiaLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabelTipoAlergia)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(buttonCambiarMotivoAtras1)
                .addContainerGap(1587, Short.MAX_VALUE))
        );

        add(panelAgregarAlergia, "cardAgregarAlergia");

        buttonCambiarMotivoAtras2.setText("Atrás");

        jScrollPane13.setViewportView(jListAgregarDiscapacidad);

        jLabelTipoDiscapacidad.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabelTipoDiscapacidad.setText("Seleccione el tipo de Discapacidad:");

        javax.swing.GroupLayout panelAgregarDiscapacidadLayout = new javax.swing.GroupLayout(panelAgregarDiscapacidad);
        panelAgregarDiscapacidad.setLayout(panelAgregarDiscapacidadLayout);
        panelAgregarDiscapacidadLayout.setHorizontalGroup(
            panelAgregarDiscapacidadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAgregarDiscapacidadLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(panelAgregarDiscapacidadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelTipoDiscapacidad)
                    .addGroup(panelAgregarDiscapacidadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(buttonCambiarMotivoAtras2)
                        .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 407, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(2976, Short.MAX_VALUE))
        );
        panelAgregarDiscapacidadLayout.setVerticalGroup(
            panelAgregarDiscapacidadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAgregarDiscapacidadLayout.createSequentialGroup()
                .addGap(17, 17, 17)
                .addComponent(jLabelTipoDiscapacidad)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(buttonCambiarMotivoAtras2)
                .addContainerGap(1585, Short.MAX_VALUE))
        );

        add(panelAgregarDiscapacidad, "cardAgregarDiscapacidad");
    }// </editor-fold>//GEN-END:initComponents

    private void userActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_userActionPerformed

    private void histogramaSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_histogramaSalirActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_histogramaSalirActionPerformed

    private void jButtonCancelarPuebasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelarPuebasActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButtonCancelarPuebasActionPerformed

    private void jComboBoxPrioridadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxPrioridadActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jComboBoxPrioridadActionPerformed

    private void jButtonAddRowMedicinasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddRowMedicinasActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButtonAddRowMedicinasActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel Abril;
    private javax.swing.JLabel Agosto;
    private javax.swing.JButton Button1;
    private javax.swing.JButton Button3;
    private javax.swing.JButton Button5;
    private javax.swing.JLabel DNIPaciente;
    private javax.swing.JLabel DNIPacienteMotivo;
    private javax.swing.JLabel Diciembre;
    private javax.swing.JLabel DireccionPaciente;
    private javax.swing.JLabel ES;
    private javax.swing.JLabel EmailPaciente;
    private javax.swing.JLabel Enero;
    private javax.swing.JLabel Febrero;
    private javax.swing.JLabel FechaPacienteMotivo;
    private javax.swing.JLabel FotoPaciente1;
    private javax.swing.JLabel FotoPacienteMotivo;
    private javax.swing.JPanel GraficoBarras;
    private javax.swing.JLabel Julio;
    private javax.swing.JLabel Junio;
    private javax.swing.JLabel Marzo;
    private javax.swing.JLabel Mayo;
    private javax.swing.JLabel MotivoPacienteMotivo;
    private javax.swing.JLabel NSSPaciente;
    private javax.swing.JLabel NSSPacienteMotivo;
    private javax.swing.JLabel NacimientoPaciente;
    private javax.swing.JLabel NombrePaciente;
    private javax.swing.JLabel Noviembre;
    private javax.swing.JLabel Octubre;
    private javax.swing.JPanel PanelDatosCita;
    private javax.swing.JPanel PanelDatosPaciente1;
    private javax.swing.JLabel Septiembre;
    private javax.swing.JLabel TelefonoPaciente;
    private javax.swing.JPanel TratamientosActuales;
    private javax.swing.JLabel US;
    private javax.swing.JPanel Valores;
    private javax.swing.JComboBox añoHistograma;
    private javax.swing.JButton buttonCambiarMotivoAtras;
    private javax.swing.JButton buttonCambiarMotivoAtras1;
    private javax.swing.JButton buttonCambiarMotivoAtras2;
    private javax.swing.JButton buttonExit;
    private javax.swing.JButton buttonFotoCam;
    private javax.swing.JButton buttonLogout;
    private javax.swing.JButton button_Formulario_Cancelar;
    private javax.swing.JButton button_Formulario_Guardar;
    private javax.swing.JLabel consultaMedico;
    private javax.swing.JLabel emailMedico;
    private javax.swing.JLabel errorLogin;
    private javax.swing.JLabel etiqueta1;
    private javax.swing.JLabel etiqueta2;
    private javax.swing.JLabel etiqueta3;
    private javax.swing.JLabel fotoMedico;
    private javax.swing.JButton histogramaSalir;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButtonAceptarPrueba;
    private javax.swing.JButton jButtonAddRowCuras;
    private javax.swing.JButton jButtonAddRowMedicinas;
    private javax.swing.JButton jButtonAddRowOtros;
    private javax.swing.JButton jButtonAgregarAlergia;
    private javax.swing.JButton jButtonAgregarDiscapacidad;
    private javax.swing.JButton jButtonCambiarFormulario;
    private javax.swing.JButton jButtonCancelarPuebas;
    private javax.swing.JButton jButtonDeleteRowCuras;
    private javax.swing.JButton jButtonDeleteRowMedicinas;
    private javax.swing.JButton jButtonDeleteRowOtros;
    private javax.swing.JButton jButtonEliminarAlergia;
    private javax.swing.JButton jButtonEliminarDiscapacidad;
    private javax.swing.JButton jButtonHistorial;
    private javax.swing.JButton jButtonHistorialAtras;
    private javax.swing.JButton jButtonImprimir;
    private javax.swing.JButton jButtonPruebas;
    private javax.swing.JComboBox jComboBoxPrioridad;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabelAlergias;
    private javax.swing.JLabel jLabelAviso;
    private javax.swing.JLabel jLabelAvisoDiagnostico;
    private javax.swing.JLabel jLabelComentario;
    private javax.swing.JLabel jLabelComentarioPrueba;
    private javax.swing.JLabel jLabelDiscapacidades;
    private javax.swing.JLabel jLabelIdioma;
    private javax.swing.JLabel jLabelPrioridad;
    private javax.swing.JLabel jLabelTipoAlergia;
    private javax.swing.JLabel jLabelTipoDiscapacidad;
    private javax.swing.JLabel jLabelTipoFormulario;
    private javax.swing.JLabel jLabelTratamiento;
    private javax.swing.JList jList1;
    private javax.swing.JList jList2;
    private javax.swing.JList jListAgregarAlergia;
    private javax.swing.JList jListAgregarDiscapacidad;
    private javax.swing.JList jListAlergias;
    private javax.swing.JList jListCambiarMotivo;
    private javax.swing.JList jListDiscapacidades;
    private javax.swing.JList jListFormularioAlergias;
    private javax.swing.JList jListFormularioDiscapacidades;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane15;
    private javax.swing.JScrollPane jScrollPane16;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTable jTableCuras;
    private javax.swing.JTable jTableDiagnosticosCuras;
    private javax.swing.JTable jTableDiagnosticosMedicamentos;
    private javax.swing.JTable jTableDiagnosticosOtros;
    private javax.swing.JTable jTableHistorialCuras;
    private javax.swing.JTable jTableHistorialDiagnosticos;
    private javax.swing.JTable jTableHistorialMedicamentos;
    private javax.swing.JTable jTableHistorialOtros;
    private javax.swing.JTable jTableMedicinas;
    private javax.swing.JTable jTableOtros;
    private javax.swing.JTable jTablePruebas;
    private javax.swing.JTable jTableTratamientosActuales;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextArea jTextAreaComentario;
    private javax.swing.JTextArea jTextAreaDiagnostico;
    private javax.swing.JTextArea jTextAreaExamenPreliminar;
    private javax.swing.JTextArea jTextAreaPrueba;
    private javax.swing.JList listaPruebas;
    private javax.swing.JLabel nombreMedico;
    private javax.swing.JPanel panel1;
    private javax.swing.JPanel panel2;
    private javax.swing.JPanel panel4;
    private javax.swing.JPanel panel5;
    private javax.swing.JPanel panel7;
    private javax.swing.JPanel panelAgregarAlergia;
    private javax.swing.JPanel panelAgregarDiscapacidad;
    private javax.swing.JPanel panelCambiarMotivo;
    private javax.swing.JPanel panelCitas;
    private javax.swing.JScrollPane panelFormularioGenerico;
    private javax.swing.JPanel panelHistorial;
    private javax.swing.JPanel panelMedico;
    private javax.swing.JPanel panelSolicitarPruebas;
    private javax.swing.JPasswordField pass;
    private javax.swing.JScrollPane scrollAlergias;
    private javax.swing.JScrollPane scrollCuras;
    private javax.swing.JScrollPane scrollDiagnosticos;
    private javax.swing.JScrollPane scrollDiagnosticosCuras;
    private javax.swing.JScrollPane scrollDiagnosticosMedicamentos;
    private javax.swing.JScrollPane scrollDiagnosticosOtros;
    private javax.swing.JScrollPane scrollDiscapacidades;
    private javax.swing.JScrollPane scrollListaPruebas;
    private javax.swing.JScrollPane scrollMedicamentos;
    private javax.swing.JScrollPane scrollOtros;
    private javax.swing.JScrollPane scrollPruebas;
    private javax.swing.JTabbedPane tabHistorial;
    private javax.swing.JTabbedPane tabHistorialDiagnosticos;
    private javax.swing.JLabel telefonoMedico;
    private javax.swing.JTextField user;
    // End of variables declaration//GEN-END:variables
    private Histogram histograma ;
    private DefaultListModel listModel;
    private DefaultListModel listModelCitas;
    private DefaultListModel listModelCambiarMotivo;
    private DefaultListModel listModelAlergias;
    private DefaultListModel listModelDiscapacidades;
    private DefaultListModel listaPruebasModel;
    private DefaultListModel listModelFormularioAlergias;
    private DefaultListModel listModelAgregarAlergia;
    private DefaultListModel listModelFormularioDiscapacidades;
    private DefaultListModel listModelAgregarDiscapacidad;
    private JComboBox comboBoxTableMedicinas= new JComboBox();
    private JComboBox comboBoxTableMedicinasMarca= new JComboBox();
    
    
    //MODELOS DE TABLAS
    private DefaultTableModel tableModelTratamientosActuales = new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Tipo", "Medico","Fecha","Nombre", "Marca", "Inicio", "Fin", "Frecuencia", "Cancelar", "Motivo Cancelacion"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Boolean.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        };
     private DefaultTableModel tableModelCuras = new javax.swing.table.DefaultTableModel(
                new Object [][] {},
                new String [] {
                    "Cura", "Inicio", "Fin", "Frecuencia"
                }
         );
        private DefaultTableModel tableModelMedicinas = new javax.swing.table.DefaultTableModel(
                new Object [][] {},
                new String [] {
                    "Medicina", "Marca","Inicio", "Fin", "Frecuencia"
                }) {
                Class[] types = new Class [] {
                    java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class
                };
                public Class getColumnClass(int columnIndex) {
                    return types [columnIndex];
                } 
        };
        private DefaultTableModel tableModelOtros= new javax.swing.table.DefaultTableModel(
                new Object [][] {},
                new String [] {
                    "Otro", "Inicio", "Fin", "Frecuencia"
                }
         );
        private DefaultTableModel tableModelHistorialPruebas = new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Medico", "Nombre", "Prioridad", "Fecha Solicitud", "Fecha Realizada", "Fecha Entregada", "Comentarios"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        };
         private DefaultTableModel tableModelHistorialCuras = new javax.swing.table.DefaultTableModel(
            new Object [][] {},
            new String [] {
                "Medico", "Fecha", "Cura", "Inicio", "Fin", "Frecuencia", "Cancelada", "Motivo Cancelacion"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        };
         private DefaultTableModel tableModelDiagnosticosCuras = new javax.swing.table.DefaultTableModel(
            new Object [][] {},
            new String [] {
                "Medico", "Fecha", "Cura", "Inicio", "Fin", "Frecuencia", "Cancelada", "Motivo Cancelacion"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        };
         
         private DefaultTableModel tableModelHistorialDiagnosticos = new javax.swing.table.DefaultTableModel(
            new Object [][] {},
            new String [] {
                "Medico", "Fecha", "Diagnostico"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false,
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        };
         
         private DefaultTableModel tableModelHistorialMedicamentos = new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Medico", "Nombre", "Marca", "Precio", "Fecha", "Inicio", "Fin", "Frecuencia", "Cancelada", "Motivo Cancelacion"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class,java.lang.String.class, java.lang.String.class,java.lang.String.class,java.lang.String.class,java.lang.Float.class,java.lang.Integer.class,java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        };
         private DefaultTableModel tableModelDiagnosticosMedicamentos = new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Medico", "Nombre", "Marca", "Precio", "Fecha", "Inicio", "Fin", "Frecuencia", "Cancelada", "Motivo Cancelacion"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class,java.lang.String.class, java.lang.String.class,java.lang.String.class,java.lang.String.class,java.lang.Float.class,java.lang.Integer.class,java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        };
            private DefaultTableModel tableModelHistorialOtros = new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Medico", "Fecha", "Inicio", "Fin", "Frecuencia", "Cancelada", "Motivo Cancelacion"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class,java.lang.String.class,java.lang.String.class,java.lang.Float.class,java.lang.Integer.class,java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false,false, false, false,false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        };
            
            private DefaultTableModel tableModelDiagnosticosOtros = new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Medico", "Fecha", "Inicio", "Fin", "Frecuencia", "Cancelada", "Motivo Cancelacion"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class,java.lang.String.class,java.lang.String.class,java.lang.Float.class,java.lang.Integer.class,java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false,false, false, false,false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        };
    
    // Asociacion de ActionListener  a los botones
    public void addButtonListener(ActionListener aLis){
        buttonCambiarMotivoAtras.addActionListener(aLis);
        Button1.addActionListener(aLis);
        Button3.addActionListener(aLis);
        Button5.addActionListener(aLis);
        añoHistograma.addActionListener(aLis);
        histogramaSalir.addActionListener(aLis);
        jButton2.addActionListener(aLis);
        jButton1.addActionListener(aLis);
        jButton3.addActionListener(aLis);
        buttonExit.addActionListener(aLis);
        buttonLogout.addActionListener(aLis);
        button_Formulario_Cancelar.addActionListener(aLis);
        button_Formulario_Guardar.addActionListener(aLis);
        buttonFotoCam.addActionListener(aLis);
        jButtonHistorial.addActionListener(aLis);
        jButtonAddRowMedicinas.addActionListener(aLis);
        jButtonDeleteRowMedicinas.addActionListener(aLis);
        jButtonAddRowCuras.addActionListener(aLis);
        jButtonDeleteRowCuras.addActionListener(aLis);
        jButtonAddRowOtros.addActionListener(aLis);
        jButtonDeleteRowOtros.addActionListener(aLis);
        jButtonCambiarFormulario.addActionListener(aLis);
        jButtonImprimir.addActionListener(aLis);
        jButtonCancelarPuebas.addActionListener(aLis);
        jButtonPruebas.addActionListener(aLis);
        jButtonAgregarAlergia.addActionListener(aLis);
        jButtonAgregarDiscapacidad.addActionListener(aLis);
        jButtonHistorialAtras.addActionListener(aLis);
        jButtonAceptarPrueba.addActionListener(aLis);
        jButtonEliminarAlergia.addActionListener(aLis);
        jButtonEliminarDiscapacidad.addActionListener(aLis);
        comboBoxTableMedicinas.addActionListener(aLis);
    }
    // Asociacion de MouseAdapter
    public void addMouseListenerES(MouseAdapter mouseAdapter){
        ES.addMouseListener(mouseAdapter);
    }
    public void addMouseListenerUS(MouseAdapter mouseAdapter){
        US.addMouseListener(mouseAdapter);
    }
    public void addMouseListener(MouseAdapter mouseAdapter){
        jList2.addMouseListener(mouseAdapter);
    }
    public void addMouseListenerListaCitas(MouseAdapter mouseAdapter){
        jList1.addMouseListener(mouseAdapter);
    }
    public void addMouseListenerListaCambiarMotivo(MouseAdapter mouseAdapter){
        jListCambiarMotivo.addMouseListener(mouseAdapter);
    }
    public void addMouseListenerListaAlergias(MouseAdapter mouseAdapter){
        jListAlergias.addMouseListener(mouseAdapter);
    }
    public void addMouseListenerListaAgregarAlergia(MouseAdapter mouseAdapter){
        jListAgregarAlergia.addMouseListener(mouseAdapter);
    }
    public void addMouseListenerListaAgregarDiscapacidad(MouseAdapter mouseAdapter){
        jListAgregarDiscapacidad.addMouseListener(mouseAdapter);
    }
    
    public void addMouseListenerListaPruebas(MouseAdapter mouseAdapter){
        listaPruebas.addMouseListener(mouseAdapter);
    }
    public void addMouseListenerTablaHistorialDiagnosticos(MouseAdapter mouseAdapter){
        jTableHistorialDiagnosticos.addMouseListener(mouseAdapter);
    }
    
    public void addMouseListenerTableMedicinas(MouseAdapter mouseAdapter){
        jTableMedicinas.addMouseListener(mouseAdapter);
    }
    
//    public void addMouseListenerComboBoxTableMedicinas(MouseAdapter mouseAdapter){
//        comboBoxTablaMedicinas.addMouseListener(mouseAdapter);
//    }
    
    //*****************************************//
    // Metodos asociados al panel 1 (Logearse) //
    //*****************************************//
    
    // Devuelve el usuario introducido
    public String getUsuario(){
        return user.getText();
    }
    // Devuelve el pass introducido
    public String getPass(){ 
        String password = new String(pass.getPassword());
        return password;
    }
    // Si el usuario o la contraseña muestra mensaje error
    public void setErrorLogin(){ 
        errorLogin.setText(userIncorrect);
    }
    public JButton getButton1(){
        return Button1;
    }
    public JButton getButtonExit(){
        return buttonExit;
    }
    public void setLabelPass(String a){
        etiqueta3.setText(a);
        
    }
    public void setButtonExit(String a){
        buttonExit.setText(a);
    }
    public void setButton1(String a){
        Button1.setText(a);
    }
    public void setLabelUser(String a){
        etiqueta2.setText(a);
        
    }
    public void setLabelLogin(String a){
        etiqueta1.setText(a);
        
    }
    public void setLabelIdioma(String a){
        jLabelIdioma.setText(a);
        
    }
    //*****************************************//
    // Metodos asociados al panel 2            //
    //*****************************************//
    public JButton getButtonLogout(){
        return buttonLogout;
    }
    public JButton getButton3(){
        return Button3;
    }
    public JButton getButton5(){
        return Button5;
    }
    public String getList1Value(){
        return jList1.getSelectedValue().toString();
    }
    public void setDatosPersonales(String[] datos){
        URL ruta = getClass().getResource(datos[4]);
        nombreMedico.setText("Nombre: "+datos[0]);
        emailMedico.setText("Email: "+datos[1]);
        consultaMedico.setText("Consulta: "+datos[2]);
        telefonoMedico.setText("Telefono: "+datos[3]);
        fotoMedico.setText("");
        if (ruta != null)
            fotoMedico.setIcon(new ImageIcon(ruta));
    }
    public String getEmailMedico(){
        return emailMedico.getText().substring(7);
    }
    public void setListModelCitas(Map<Integer,PacienteCita> pacientesCita){
        listModelCitas.clear();
        int numCitas= pacientesCita.size();
        for(int i=0;i<numCitas;i++){
            listModelCitas.addElement(pacientesCita.get(i));
        }
    }
    public ListModel getListModelCitas(){
        return listModelCitas;
    }
    public JList getJList1(){
        return jList1;
    }
    public void setMotivo(String motivo){
        MotivoPacienteMotivo.setText("Motivo: "+motivo);
    }
    public void setDatosCita(Cita cita){
        DNIPacienteMotivo.setText("DNI: "+cita.getDNI());
        NSSPacienteMotivo.setText("NSS: "+cita.getNSS());
        MotivoPacienteMotivo.setText("Motivo: "+cita.getMotivo());
        FechaPacienteMotivo.setText("Fecha: "+cita.getFecha());
    }
    public Cita getDatosCita(){
        Cita cita = new Cita();
        cita.setDNI(DNIPacienteMotivo.getText());
        cita.setNSS(NSSPacienteMotivo.getText());
        cita.setMotivo(MotivoPacienteMotivo.getText());
        cita.setFecha(FechaPacienteMotivo.getText());
        return cita;
    }
    public JPanel getPanelDatosCita(){
        return PanelDatosCita;
    }
      
    //*********************************************//
    // Metodos asociados al panel Cambiar Motivo   //
    //*********************************************//
    
    public JButton getButtonCambiarMotivoAtras(){
        return buttonCambiarMotivoAtras;
    }
         
    public void setListModelCambiarMotivo(){
        listModelCambiarMotivo.clear();
        listModelCambiarMotivo.addElement(new TipoFormulario(Tipo.GENERICO));
        listModelCambiarMotivo.addElement(new TipoFormulario(Tipo.CARDIACO));
        listModelCambiarMotivo.addElement(new TipoFormulario(Tipo.ROTURA));
    }
    public ListModel getListModelCambiarMotivo(){
        return listModelCambiarMotivo;
    }
    public JList getJListCambiarMotivo(){
        return jListCambiarMotivo;
    } 
     
    //*****************************************//
    // Metodos asociados al panel 4           //
    //*****************************************//
 
    public void configHistograma(Map<String,float[]> hMap,Vistas ventana){
        //histograma.setComboBoxAddItem(hMap);
        histograma.configurar(hMap,ventana);
        setAñoHistograma(hMap);
        
    }
    public void setAñoHistograma(Map<String,float[]> hMap){
        Set st = hMap.keySet();
        Iterator itr = st.iterator();
        añoHistograma.removeAllItems();
        while(itr.hasNext())
            añoHistograma.addItem(itr.next()); 
    }
    public JComboBox getAñoHistograma(){
        return añoHistograma;
    }
    
    public void dibujarHistograma(float[] datos){
        histograma.dibujarHistograma(datos);
    }
    public JButton getHistogramaSalir(){
        return histogramaSalir;
    }
    public void setEnero(int i){
        Enero.setText("Enero: "+ i);
    }
    public void setGastosMeses(float datos[]){
        
        Enero.setText("Enero: "+ datos[0]);
        Febrero.setText("Febrero: "+ datos[1]); 
        Marzo.setText("Marzo: "+ datos[2]); 
        Abril.setText("Abril: "+ datos[3]); 
        Mayo.setText("Mayo: "+ datos[4]); 
        Junio.setText("Junio: "+ datos[5]); 
        Julio.setText("Julio: "+ datos[6]); 
        Agosto.setText("Agosto: "+ datos[7]); 
        Septiembre.setText("Septiembre: "+ datos[8]);
        Octubre.setText("Octubre: "+ datos[9]); 
        Noviembre.setText("Noviembre: "+ datos[10]); 
        Diciembre.setText("Diciembre: "+ datos[11]); 
        
    }
    
    //*******************************************//
    // Panel 5: Lector de mail                   //
    //*******************************************//
    public ListModel getListModel(){
        return listModel;
    }
    public JList getJList2(){
        return jList2;
    }
    public JButton getJButton2(){
        return jButton2;
    }
    public JButton getJButton1(){
        return jButton1;
    }
    public JButton getJButton3(){
        return jButton3;
    }
    public JTextArea getJTextArea1(){
        return jTextArea1;
    }
    public void setListModel(Mensaje[] mensajeList){
        listModel.clear();
        for(int i=0;i<mensajeList.length;i++){
            listModel.addElement(mensajeList[i]);
        }
    }
     //*******************************************//
    // Panel 6: Formulario                       //
    //*******************************************//
    public JTable getJTableMedicinas(){
        return jTableMedicinas;
    }
    public JScrollPane getJPanelFormulario(){
        return panelFormularioGenerico;
    }
     public String getDNIFormulario(){
         return DNIPaciente.getText();
     }
     public String getNSSFormulario(){
         return NSSPaciente.getText();
     }
     public JButton getButton_Formulario_Cancelar(){
        return button_Formulario_Cancelar;
     }    
     public JButton getButton_Formulario_Guardar(){
        return button_Formulario_Guardar;
     }
     public JButton getButtonCambiarFormulario(){
        return jButtonCambiarFormulario;
    }
     public JTextArea getTextDiagnostico(){
        return jTextAreaDiagnostico;
    }
    public JTextArea getTextComentario(){
        return jTextAreaComentario;
    }
    public JTextArea getTextExamenPreliminar(){
        return jTextAreaExamenPreliminar;
    }
     public void setDatosPaciente(String[] datos){
        URL ruta = getClass().getResource(datos[7]);
        DNIPaciente.setText("DNI: "+datos[0]);
        NSSPaciente.setText("NSS: "+datos[1]);
        NombrePaciente.setText("Nombre: "+datos[2]);
      //  HistorialPaciente.setText("Historial: "+datos[3]);
        DireccionPaciente.setText("Dirección: "+datos[4]);
        TelefonoPaciente.setText("Teléfono: "+ datos[5]);
      //  ComentarioPaciente.setText("Comentario: "+datos[6]);
        NacimientoPaciente.setText("Nacimiento: "+datos[8]);
        EmailPaciente.setText("Email: "+datos[9]);
        if (ruta != null)
            FotoPaciente1.setIcon(new ImageIcon(ruta));
    }
   
    public JButton getButtonFotaCam(){
        return buttonFotoCam;
    }
    public JButton getButtonHistorial(){
        return jButtonHistorial;
    }
    
     public JButton getButtonPruebas(){
        return jButtonPruebas;
    }
    public JButton getButtonEliminarAlergia(){
        return jButtonEliminarAlergia;
    }
    public JButton getButtonEliminarDiscapacidad(){
        return jButtonEliminarDiscapacidad;
    }
    
    public JButton getButtonAddRowMedicinas(){
        return jButtonAddRowMedicinas;
    }

    public JButton getButtonDeleteRowMedicinas(){
        return jButtonDeleteRowMedicinas;
    }

    public JButton getButtonAddRowCuras(){
        return jButtonAddRowCuras;
    }

    public JButton getButtonDeleteRowCuras(){
        return jButtonDeleteRowCuras;
    }

    public JButton getButtonAddRowOtros(){
        return jButtonAddRowOtros;
    }

    public JButton getButtonDeleteRowOtros(){
        return jButtonDeleteRowOtros;
    }
    
    public JButton getButtonAgregarAlergia(){
        return jButtonAgregarAlergia;
    }
    
    public JButton getButtonAgregarDiscapacidad(){
        return jButtonAgregarDiscapacidad;
    }
    
    public void setComentario(String comentario){
        jTextAreaComentario.setText(comentario);
    }
 
    public void clearTableModelTratamientosActuales(){
        for(int i=(tableModelTratamientosActuales.getRowCount()-1); i>=0; i--){
            tableModelTratamientosActuales.removeRow(i);            
        }
    }
    public void clearTableModelMedicinas(){
        for(int i=(tableModelMedicinas.getRowCount()-1); i>=0; i--){
            tableModelMedicinas.removeRow(i);            
        }
    }
    public void clearTableModelCuras(){
        for(int i=(tableModelCuras.getRowCount()-1); i>=0; i--){
            tableModelCuras.removeRow(i);            
        }
    }
    public void clearTableModelOtros(){
        for(int i=(tableModelOtros.getRowCount()-1); i>=0; i--){
            tableModelOtros.removeRow(i);            
        }
    }
   public void addRowTableModelTratamientosActuales(String tipo, ArrayList<Tratamiento> lista){
        for(Tratamiento t: lista) tableModelTratamientosActuales.addRow(new Object[] {tipo,t.getMedico(),t.getFecha(),t.getNombre(),t.getMarca(),t.getInicio(),t.getFin(),t.getFrecuencia(),t.isCancelada(),t.getMotivoCancelacion()});
    }

    public void addRowNullTableModelMedicinas(){
       tableModelMedicinas.addRow(new Object [] {null, null, null, null, null});
    }

    public void deleteRowTableModelMedicinas(){
        int numRow = tableModelMedicinas.getRowCount();
        if (numRow > 0) tableModelMedicinas.removeRow(numRow-1);
    }

    public void addRowNullTableModelCuras(){
       tableModelCuras.addRow(new Object [] {null, null, null, null});
    }

    public void deleteRowTableModelCuras(){
        int numRow = tableModelCuras.getRowCount();
        if (numRow > 0) tableModelCuras.removeRow(numRow-1);
    }

    public void addRowNullTableModelOtros(){
       tableModelOtros.addRow(new Object [] {null, null, null, null});
    }
    
    public void deleteRowTableModelOtros(){
        int numRow = tableModelOtros.getRowCount();
        if (numRow > 0) tableModelOtros.removeRow(numRow-1);
    }
    

    public JComboBox getComboBoxTableMedicinas(){
        return comboBoxTableMedicinas;
    }
      public JComboBox getComboBoxTableMedicinasMarca(){
        return comboBoxTableMedicinasMarca;
    }
    
    public void setUpColumnaMedicinas( ArrayList<String> lista) {    
        TableColumn columnaMedicinas = jTableMedicinas.getColumnModel().getColumn(0);
        comboBoxTableMedicinas.removeAllItems();
        for(String i : lista){
            comboBoxTableMedicinas.addItem(i);
        }
        columnaMedicinas.setCellEditor(new DefaultCellEditor(comboBoxTableMedicinas));
        DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
        renderer.setToolTipText("Haga click aquí para ver las medicinas disponibles");
        columnaMedicinas.setCellRenderer(renderer);
    }
    public void setUpColumnaMedicinasMarca( ArrayList<String> lista) {    
        TableColumn columnaMedicinas = jTableMedicinas.getColumnModel().getColumn(1);
        for(String i : lista){
            comboBoxTableMedicinasMarca.addItem(i);
        }
        columnaMedicinas.setCellEditor(new DefaultCellEditor(comboBoxTableMedicinasMarca));

        DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
        renderer.setToolTipText("Haga click aquí para desplegar");
        columnaMedicinas.setCellRenderer(renderer);
    }
    public void setListModelFormularioAlergias(ArrayList<String> lista){
        listModelFormularioAlergias.clear();
        for(String i : lista) listModelFormularioAlergias.addElement(i);
    }
    public void addListModelFormularioAlergias(String alergia){
        listModelFormularioAlergias.addElement(alergia);
    }
    public void setListModelFormularioDiscapacidades(ArrayList<String> lista){
        listModelFormularioDiscapacidades.clear();
        for(String i : lista) listModelFormularioDiscapacidades.addElement(i);
    }
    public void addListModelFormularioDiscapacidades(String discapacidad){
        listModelFormularioDiscapacidades.addElement(discapacidad);
    }
    public void setListModelAgregarAlergia(ArrayList<String> lista){
        listModelAgregarAlergia.clear();
        for(String i : lista) listModelAgregarAlergia.addElement(i);
    }
    public DefaultListModel getListModelAgregarAlergia(){
        return listModelAgregarAlergia;
    }
    public JList getJListAgregarAlergia(){
        return jListAgregarAlergia;
    }
    public void setListModelAgregarDiscapacidad(ArrayList<String> lista){
        listModelAgregarDiscapacidad.clear();
        for(String i : lista) listModelAgregarDiscapacidad.addElement(i);
    }
    public DefaultListModel getListModelAgregarDiscapacidad(){
        return listModelAgregarDiscapacidad;
    }
    public JList getJListAgregarDiscapacidad(){
        return jListAgregarDiscapacidad;
    }
    public DefaultListModel getListModelFormularioAlergias(){
        return listModelFormularioAlergias;
    }
    public JList getJListFormularioAlergias(){
        return jListFormularioAlergias;
    }
    public DefaultListModel getListModelFormularioDiscapacidades(){
        return listModelFormularioDiscapacidades;
    }
    public JList getJListFormularioDiscapacidades(){
        return jListFormularioDiscapacidades;
    }
    public DefaultTableModel getTableModelMedicinas(){
        return tableModelMedicinas;
    }
    public DefaultTableModel getTableModelCuras(){
        return tableModelCuras;
    }
    public DefaultTableModel getTableModelOtros(){
        return tableModelOtros;
    }
    public DefaultTableModel getTableModelTratamientosActuales(){
        return tableModelTratamientosActuales;
    }
    public JPanel getPanelFormularioGenerico(){
        return panel7;             
    }
    public void formatoImpresionPanelFormulario(Boolean formatoImpresion){
        Component[] components = panel7.getComponents();
       
        for(int i=0;i<components.length;i++){
            
            if("javax.swing.JButton".equals(components[i].getClass().getName())){
                components[i].setVisible(!formatoImpresion);
            }else{
                if (formatoImpresion){
                    components[i].setBackground(Color.WHITE);
                    panel7.setBackground(Color.WHITE);
                    
                }
                else{
                    components[i].setBackground(new Color(240, 240, 240));
                    panel7.setBackground(new Color(240, 240, 240));
                    
                }
            }
        }
    }
 
    public JButton getButtonImprimir(){
        return jButtonImprimir;
    }
    
    public ArrayList<ArrayList<Object>> getCampostableModel(DefaultTableModel table){
        ArrayList<ArrayList<Object>> filas = new ArrayList<ArrayList<Object>>();
        int numRow = table.getRowCount();
        int numColum = table.getColumnCount();
        for (int i=0; i<numRow; i++){
            ArrayList<Object> columnas=new ArrayList<Object>();
            filas.add(columnas);
            for(int j=0; j<numColum; j++){
                columnas.add(table.getValueAt(i,j));
            }
        }
        return filas;
    }
    
      public ArrayList<String> getListModel(DefaultListModel listModel){
          int tam = listModel.getSize();
          ArrayList<String> lista = new ArrayList<String>();
          for (int i=0; i<tam ; i++){
            lista.add((String)listModel.getElementAt(i));
          }
          return lista;
      }
        public void setTextLabelAvisoDiagnostico(String aviso){
       
        jLabelAvisoDiagnostico.setText(aviso);
    
    }
      
     //*******************************************//
    // Panel Historial                           //
    //*******************************************//
    public void addRowTableModelHistorialPruebas(ArrayList<Pruebas> lista){
        for(Pruebas pru: lista) tableModelHistorialPruebas.addRow(new Object[] {pru.getNombreMedico(),pru.getNombre(),pru.getPrioridad(),pru.getFechaSolicitud(),pru.getFechaRealizada(),pru.getFechaEntregada(),pru.getComentario()});
    }
    public void addRowTableModelHistorialCuras(ArrayList<Curas> lista){
        for(Curas cur: lista) tableModelHistorialCuras.addRow(new Object[] {cur.getNombreMedico(),cur.getFecha(),cur.getCura(),cur.getInicio(),cur.getFin(),cur.getFrecuencia(),cur.getCancelada(),cur.getMotivoCancelacion()});
    }
    public void addRowTableModelHistorialDiagnosticos(ArrayList<Diagnosticos> lista){
        for(Diagnosticos dia: lista) tableModelHistorialDiagnosticos.addRow(new Object[] {dia.getNombreMedico(),dia.getFecha(),dia.getDiagnostico()});
    }
    public void addRowTableModelHistorialMedicamentos(ArrayList<Medicamentos> lista){
        for(Medicamentos med: lista) tableModelHistorialMedicamentos.addRow(new Object[] {med.getNombreMedico(),med.getNombre(),med.getMarca(),med.getPrecio(),med.getFecha(),med.getInicio(),med.getFin(),med.getFrecuencia(),med.getCancelada(),med.getMotivoCancelacion()});
    }
    public void addRowTableModelHistorialOtros(ArrayList<Otros> lista){
        for(Otros otr: lista) tableModelHistorialOtros.addRow(new Object[] {otr.getNombreMedico(),otr.getFecha(),otr.getInicio(),otr.getFin(),otr.getFrecuencia(),otr.getCancelada(),otr.getMotivoCancelacion()});
    }
    public void addRowTableModelDiagnosticosCuras(ArrayList<Curas> lista){
        for(Curas cur: lista) tableModelDiagnosticosCuras.addRow(new Object[] {cur.getNombreMedico(),cur.getFecha(),cur.getCura(),cur.getInicio(),cur.getFin(),cur.getFrecuencia(),cur.getCancelada(),cur.getMotivoCancelacion()});
    }
    public void addRowTableModelDiagnosticosOtros(ArrayList<Otros> lista){
        for(Otros otr: lista) tableModelDiagnosticosOtros.addRow(new Object[] {otr.getNombreMedico(),otr.getFecha(),otr.getInicio(),otr.getFin(),otr.getFrecuencia(),otr.getCancelada(),otr.getMotivoCancelacion()});
    }
    public void addRowTableModelDiagnosticosMedicamentos(ArrayList<Medicamentos> lista){
        for(Medicamentos med: lista) tableModelDiagnosticosMedicamentos.addRow(new Object[] {med.getNombreMedico(),med.getNombre(),med.getMarca(),med.getPrecio(),med.getFecha(),med.getInicio(),med.getFin(),med.getFrecuencia(),med.getCancelada(),med.getMotivoCancelacion()});
    }
    
    public int vaciaLista(ArrayList<Diagnosticos> lista){
        if(lista.isEmpty()==false)
            return 0;
        else
            return 1;
    }
    
    public JTable getJTableHistorialDiagnosticos(){
        return jTableHistorialDiagnosticos;
    }
    public JTabbedPane getJTabbedPaneHistorialDiagnosticos(){
        return tabHistorialDiagnosticos;
    }
    
    public void limpiarTablaHistorialPruebas(){
        for(int i=(tableModelHistorialPruebas.getRowCount()-1); i>=0; i--){
            tableModelHistorialPruebas.removeRow(i);            
        }
    }
    public void limpiarTablaHistorialDiagnosticos(){
        for(int i=(tableModelHistorialDiagnosticos.getRowCount()-1); i>=0; i--){
            tableModelHistorialDiagnosticos.removeRow(i);            
        }
    }
    public void limpiarTablaHistorialCuras(){
        for(int i=(tableModelHistorialCuras.getRowCount()-1); i>=0; i--){
            tableModelHistorialCuras.removeRow(i);            
        }
    }
    public void limpiarTablaDiagnosticosCuras(){
        for(int i=(tableModelDiagnosticosCuras.getRowCount()-1); i>=0; i--){
            tableModelDiagnosticosCuras.removeRow(i);            
        }
    }
    public void limpiarTablaDiagnosticosOtros(){
        for(int i=(tableModelDiagnosticosOtros.getRowCount()-1); i>=0; i--){
            tableModelDiagnosticosOtros.removeRow(i);            
        }
    }
    public void limpiarTablaDiagnosticosMedicamentos(){
        for(int i=(tableModelDiagnosticosMedicamentos.getRowCount()-1); i>=0; i--){
            tableModelDiagnosticosMedicamentos.removeRow(i);            
        }
    }
    public void limpiarTablaHistorialMedicamentos(){
        for(int i=(tableModelHistorialMedicamentos.getRowCount()-1); i>=0; i--){
            tableModelHistorialMedicamentos.removeRow(i);            
        }
    }
    public void limpiarTablaHistorialOtros(){
        for(int i=(tableModelHistorialOtros.getRowCount()-1); i>=0; i--){
            tableModelHistorialOtros.removeRow(i);            
        }
    }
    public void setListModelAlergias(Map<Integer,Historial> historia){
        listModelAlergias.clear();
        int numAlergias= historia.size();
        for(int i=0;i<numAlergias;i++){
            listModelAlergias.addElement(historia.get(i));            
        }
    }    
    public JList getJListAlergias(){
        return jListAlergias;
    }
    public ListModel getListModelAlergias(){
        return listModelAlergias;
    }
    public void setListModelDiscapacidades(Map<Integer,Discapacidades> disca){
        listModelDiscapacidades.clear();
        int numDis= disca.size();
        for(int i=0;i<numDis;i++){
            listModelDiscapacidades.addElement(disca.get(i));            
        }
    }    
    public JList getJListDiscapacidades(){
        return jListDiscapacidades;
    }
    public ListModel getListModelDiscapacidades(){
        return listModelDiscapacidades;
    }
    public JButton getButtonHistorialAtras(){
        return jButtonHistorialAtras;
    }
    //**********************************************//
    //Panel solicitar pruebas                   //
    //*********************************************//
    
    public JPanel getJPanelSolicitarPruebas(){
        return panelSolicitarPruebas;
    }
    public JButton getButtonCancelarPuebas(){
        return jButtonCancelarPuebas;
    }
    public JList getJListaPruebas(){
        return listaPruebas;
    }
    public DefaultListModel getJListaPruebasModel(){
        return listaPruebasModel;
    }
   
    public void setlistaPruebasModel(Mensaje[] mensajeList){
        listaPruebasModel.clear();
        for(int i=0;i<mensajeList.length;i++){
            listaPruebasModel.addElement(mensajeList[i]);
        }
    }
    public JButton getButtonAceptarPrueba(){
        return jButtonAceptarPrueba;
    }
    
    public JComboBox getComboBoxPrioridad(){
        return jComboBoxPrioridad;
    }
    public JTextArea getTextAreaComentarioPrueba(){
        return jTextAreaPrueba;
    }
    public JLabel getLabelAviso(){
        return jLabelAviso;
    }
    public void setTextLabelAviso(String aviso){
       
        jLabelAviso.setText(aviso);
    
    }
}
